package com.xdtech.hotel.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.xdtech.core.model.BaseModel;

/**
 * 
 * @author max.zheng
 * @create 2015-04-23 22:10:38
 * @since 1.0
 * @see 
 */
@Entity
@Table(name="HOTEL_DEVICE_OPERATION")
public class DeviceOperation extends BaseModel implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	@Column(name="NAME")
	private String name;
	@Column(name="TYPE")
	private String type;
	
//	@ManyToMany
//	@JoinTable(name="HOTEL_LINKAGE_OPERATION_CONFIG", 
//			   joinColumns={@JoinColumn(name="LINKAGE_ID",
//			                            referencedColumnName="ID")},
//			   inverseJoinColumns={@JoinColumn(name="OPERATION_ID",
//                                    referencedColumnName="ID")}
//    )
	@ManyToMany(mappedBy = "deviceOperations")
	private List<LinkageConfig> linkageConfigs = new ArrayList<LinkageConfig>();

	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getType() {
		return type;
	}
	public List<LinkageConfig> getLinkageConfigs() {
		return linkageConfigs;
	}
	public void setLinkageConfigs(List<LinkageConfig> linkageConfigs) {
		this.linkageConfigs = linkageConfigs;
	}
	
	
}
